import { axios } from '@/utils/request'

export function fetchList (params) {
  return axios({
    url: '/sys/user/list',
    method: 'get',
    params: params
  })
}

/**
 * 高级查询
 * @param id
 * @return
 */
export function PageList (params) {
  return axios({
    url: `/sys/user/queryPageList`,
    method: 'GET',
    params: {
      ...params
    }
  })
}

export function getObj (id) {
  return axios({
    url: '/sys/user/info/' + id,
    method: 'get'
  })
}

export function addObj (obj) {
  return axios({
    url: '/sys/user/save',
    method: 'POST',
    data: obj
  })
}

export function putObj (obj) {
  return axios({
    url: '/sys/user/update',
    method: 'POST',
    data: obj
  })
}

export function delObj (id) {
  return axios({
    url: '/sys/user/delete/' + id,
    method: 'GET'
  })
}

export function updatePassword (obj) {
  return axios({
    url: '/sus/user/updatePassowrd',
    method: 'PUT',
    data: obj
  })

}

export function binding () {
  return axios({
    url: '/sys/user/binding',
    method: 'get'
  })
}

export function dropList () {
  return axios({
    url: '/sys/user/dropDown',
    method: 'get'
  })
}

/**
 * 测试
 * @returns {AxiosPromise}
 */
export function selectList () {
  return axios({
    url: '/sys/user/test01',
    method: 'get'
  })
}